<template>
  <div>
    我是child组件
    {{ data }}
    <button type="button" @click="changecarname">修改车辆数据</button>
    <button type="button" @click="changecarcolor">修改车辆数据</button>
  </div>
</template>

<script setup name="child">
const data = defineProps(["val", "msg"]);
const emits = defineEmits(["handleone", "handletwo"]); // 定义一个或多个自定义事件
const changecarname = () => {
  console.log(`output->11`, 11);
   let name='特能拉'
  emits("handleone",name);
};
const changecarcolor = () => {
  console.log(`output->22`, 22);
  let tempColor='黄色'
  emits("handletwo", {color:tempColor,size:10});
};
console.log("[ childdata ] >", data);
</script>

<style lang="less" scoped></style>
